#include "llvm/PassManager.h"
#include "llvm/Transforms/IPO/PassManagerBuilder.h"
#include "llvm/Support/CommandLine.h"
#include "DINO.h"

// The runtime must define this function.
const char *DINOTaskBoundaryFunctionName = "__DINO_task_boundary";

const char *DINOVersionFunctionName = "__DINO_version";

const char *DINOPrefix = "__DINO_";

// Nonvolatile globals need to be prefixed with this name for us to recognize
// them as such.
const char *NVGlobalPrefix = "__NV_";

namespace {
    static void registerDINO (const llvm::PassManagerBuilder &,
            llvm::PassManagerBase &PM) {
        PM.add(new DINOStoreAnalysis());
        PM.add(llvm::createDINOVersioner());
    }

    // Run DINO pass after all other optimizations.
    static llvm::RegisterStandardPasses
        RegisterDINO(llvm::PassManagerBuilder::EP_OptimizerLast, registerDINO);
}
